//获取className兼容函数
function getClass(classname,obj){
	var obj=obj||document;
	var arr=[];
	if(obj.getElementsByClassName){
		return obj.getElementsByClassName(classname)	
	}else{
		var all=obj.getElementsByTagName("*");
		for(var i=0;i<all.length;i++){
			if(checkClass(all[i].className,classname)){
				arr.push(all[i]);	
			};	
		};	
		return arr;
	};	
};
	function checkClass(moreclass,val){
		var arr=moreclass.split(" ");
		for(var i=0;i<arr.length;i++){
			if(arr[i]==val){
				return true;	
			};	
		};	
		return false
	}

//获取样式
function getStyle(obj,attr){
	if(obj.currentStyle){
		return obj.currentStyle[attr];	
	}else{
		return getComputedStyle(obj,null)[attr];
	}
	
};
 //添加多个事件
 function addEvent (obj,ev,fn) {
  if(obj.attachEvent){
    obj.attachEvent("on"+ev,function  () {
	   fn.call(obj);
    });
  }else{
   obj.addEventListener(ev,fn,false);
  }
}
 //添加多个事件
 function addEvent (obj,ev,fn) {
  if(obj.attachEvent){
    obj.attachEvent("on"+ev,function  () {
	   fn.call(obj);
    });
  }else{
   obj.addEventListener(ev,fn,false);
  }
}

//删除事件
 function delEvent (obj,ev,fn) {
    if(obj.removeEventListener){
	obj.removeEventListener(ev,fn,false) 
	}else{
	  alert("aa");
	 obj.detachEvent("on"+ev,fn) 
	}
  }




